package com.block.datapush.special.service.impl;

import com.block.datapush.model.dto.StarInfoDTO;
import com.block.datapush.special.service.ISpecialDataStarAddupInfoService;
import com.block.db.entity.SpecialDataStarAddupInfo;
import com.block.db.mapper.SpecialDataStarAddupInfoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

/**
 * <p>
 * 机构星级回传详情信息 服务实现类
 * </p>
 *
 * @author 
 * @since 2024-11-11
 */
@Service
public class SpecialDataStarAddupInfoServiceImpl extends ServiceImpl<SpecialDataStarAddupInfoMapper, SpecialDataStarAddupInfo> implements ISpecialDataStarAddupInfoService {

    @Override
    public void saveStarAddup(StarInfoDTO starInfoDTO){

        SpecialDataStarAddupInfo starAddupInfo = new SpecialDataStarAddupInfo();
        starAddupInfo.setInfoId(starInfoDTO.getInfoId());
        starAddupInfo.setInfoName(starInfoDTO.getInfoName());
        starAddupInfo.setDateInfo(LocalDate.now().toString());
        starAddupInfo.setUid(starInfoDTO.getUid());
        starAddupInfo.setMobileMd5(starInfoDTO.getMobileMd5());
        starAddupInfo.setChannelCode(starInfoDTO.getChannelCode());
        starAddupInfo.setChannelName(starInfoDTO.getChannelName());
        starAddupInfo.setStarNumber(starInfoDTO.getStarLevel());

        this.save(starAddupInfo);
    }
}
